package edu.guet.server.controller;

import edu.guet.server.model.dto.PaperSelDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import edu.guet.server.model.PaperStore;
import edu.guet.server.service.PaperStoreService;
import edu.guet.server.utils.ResultAPI;

import java.util.List;

@RestController
@RequestMapping("/paperStore")
public class PaperStoreController {
    @Autowired
    PaperStoreService paperStoreService;

    @RequestMapping("/setPaperStore")
    public ResultAPI setPaperStore(@RequestBody PaperStore paperStore){
        return paperStoreService.setPaperStore(paperStore);
    }

    @RequestMapping("/getPaperStore")
    public ResultAPI getPaperStore(@RequestParam Integer tech_id){
        return paperStoreService.getPaperStore(tech_id);
    }

    @RequestMapping("/deletePaperStore")
    public ResultAPI deletePaperStore(@RequestParam("paper_id") int paper_id){
        return paperStoreService.deletePaperStore(paper_id);
    }
    @PostMapping("AddSeltoPaper")
    public ResultAPI addSeltoPaper(@RequestParam Integer paper_id,@RequestBody List<Integer> qsIds){
        return paperStoreService.addQsPaper(paper_id,qsIds);
    }
}
